home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.004 / xemacs-1 / xemacs-19.13 / src / objects.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-29  |  6.4 KB  |  175 lines

  1. /* Generic object functions.
  2.    Copyright (C) 1995 Board of Trustees, University of Illinois.
  3.    Copyright (C) 1995 Ben Wing.
  4.  
  5. This file is part of XEmacs.
  6.  
  7. XEmacs is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. XEmacs is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with XEmacs; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21. #ifndef _XEMACS_OBJECTS_H_
  22. #define _XEMACS_OBJECTS_H_
  23.  
  24. #include "specifier.h"
  25.  
  26. extern void finalose (void *ptr);
  27.  
  28. /*****************************************************************************
  29.  *                        Color Specifier Object                             *
  30.  *****************************************************************************/
  31.  
  32. struct color_specifier
  33. {
  34.   Lisp_Object face;        /* face this is attached to, or nil */
  35.   Lisp_Object face_property;    /* property of that face */
  36. };
  37.  
  38. #define COLOR_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, color))
  39. #define COLOR_SPECIFIER_FACE(g) (COLOR_SPECIFIER_DATA (g)->face)
  40. #define COLOR_SPECIFIER_FACE_PROPERTY(g) \
  41.   (COLOR_SPECIFIER_DATA (g)->face_property)
  42.  
  43. DECLARE_SPECIFIER_TYPE (color);
  44. extern Lisp_Object Qcolor;
  45. #define XCOLOR_SPECIFIER(x) XSPECIFIER_TYPE (x, color)
  46. #define XSETCOLOR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, color)
  47. #define COLOR_SPECIFIERP(x) SPECIFIER_TYPEP (x, color)
  48. #define CHECK_COLOR_SPECIFIER(x, i) CHECK_SPECIFIER_TYPE (x, i, color)
  49.  
  50. extern void set_color_attached_to (Lisp_Object obj, Lisp_Object face,
  51.                    Lisp_Object property);
  52.  
  53. /*****************************************************************************
  54.  *                         Font Specifier Object                             *
  55.  *****************************************************************************/
  56.  
  57. struct font_specifier
  58. {
  59.   Lisp_Object face;        /* face this is attached to, or nil */
  60.   Lisp_Object face_property;    /* property of that face */
  61. };
  62.  
  63. #define FONT_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, font))
  64. #define FONT_SPECIFIER_FACE(g) (FONT_SPECIFIER_DATA (g)->face)
  65. #define FONT_SPECIFIER_FACE_PROPERTY(g) \
  66.   (FONT_SPECIFIER_DATA (g)->face_property)
  67.  
  68. DECLARE_SPECIFIER_TYPE (font);
  69. extern Lisp_Object Qfont;
  70. #define XFONT_SPECIFIER(x) XSPECIFIER_TYPE (x, font)
  71. #define XSETFONT_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, font)
  72. #define FONT_SPECIFIERP(x) SPECIFIER_TYPEP (x, font)
  73. #define CHECK_FONT_SPECIFIER(x, i) CHECK_SPECIFIER_TYPE (x, i, font)
  74.  
  75. extern void set_font_attached_to (Lisp_Object obj, Lisp_Object face,
  76.                   Lisp_Object property);
  77.  
  78. /*****************************************************************************
  79.  *                       Face Boolean Specifier Object                       *
  80.  *****************************************************************************/
  81.  
  82. struct face_boolean_specifier
  83. {
  84.   Lisp_Object face;        /* face this is attached to, or nil */
  85.   Lisp_Object face_property;    /* property of that face */
  86. };
  87.  
  88. #define FACE_BOOLEAN_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, face_boolean))
  89. #define FACE_BOOLEAN_SPECIFIER_FACE(g) (FACE_BOOLEAN_SPECIFIER_DATA (g)->face)
  90. #define FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY(g) \
  91.   (FACE_BOOLEAN_SPECIFIER_DATA (g)->face_property)
  92.  
  93. DECLARE_SPECIFIER_TYPE (face_boolean);
  94. extern Lisp_Object Qface_boolean;
  95. #define XFACE_BOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, face_boolean)
  96. #define XSETFACE_BOOLEAN_SPECIFIER(x, p) \
  97.   XSETSPECIFIER_TYPE (x, p, face_boolean)
  98. #define FACE_BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, face_boolean)
  99. #define CHECK_FACE_BOOLEAN_SPECIFIER(x, i) \
  100.   CHECK_SPECIFIER_TYPE (x, i, face_boolean)
  101.  
  102. extern void set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face,
  103.                       Lisp_Object property);
  104.  
  105. /****************************************************************************
  106.  *                           Color Instance Object                          *
  107.  ****************************************************************************/
  108.  
  109. DECLARE_LRECORD (color_instance, struct Lisp_Color_Instance);
  110. #define XCOLOR_INSTANCE(x) \
  111.   XRECORD (x, color_instance, struct Lisp_Color_Instance)
  112. #define XSETCOLOR_INSTANCE(x, p) XSETRECORD (x, p, color_instance)
  113. #define COLOR_INSTANCEP(x) RECORDP (x, color_instance)
  114. #define CHECK_COLOR_INSTANCE(x, i) CHECK_RECORD (x, color_instance)
  115.  
  116. extern Lisp_Object Fmake_color_instance (Lisp_Object name, Lisp_Object device,
  117.                      Lisp_Object no_error);
  118. extern Lisp_Object Fcolor_instance_p (Lisp_Object obj);
  119. extern Lisp_Object Fcolor_instance_name (Lisp_Object obj);
  120.  
  121. struct Lisp_Color_Instance
  122. {
  123.   struct lcrecord_header header;
  124.   Lisp_Object name;
  125.   Lisp_Object device;
  126.  
  127.   /* device-type-specific data */
  128.   void *data;
  129. };
  130.  
  131. #define COLOR_INSTANCE_NAME(c) ((c)->name)
  132. #define COLOR_INSTANCE_DEVICE(c) ((c)->device)
  133.  
  134. /****************************************************************************
  135.  *                            Font Instance Object                          *
  136.  ****************************************************************************/
  137.  
  138. DECLARE_LRECORD (font_instance, struct Lisp_Font_Instance);
  139. #define XFONT_INSTANCE(x) XRECORD (x, font_instance, struct Lisp_Font_Instance)
  140. #define XSETFONT_INSTANCE(x, p) XSETRECORD (x, p, font_instance)
  141. #define FONT_INSTANCEP(x) RECORDP (x, font_instance)
  142. #define CHECK_FONT_INSTANCE(x, i) CHECK_RECORD (x, font_instance)
  143.  
  144. extern Lisp_Object Fmake_font_instance (Lisp_Object name, Lisp_Object device,
  145.                     Lisp_Object no_error);
  146. extern Lisp_Object Ffont_instance_p (Lisp_Object obj);
  147. extern Lisp_Object Ffont_instance_name (Lisp_Object obj);
  148. extern Lisp_Object Ffont_instance_truename (Lisp_Object obj);
  149.  
  150. struct Lisp_Font_Instance
  151. {
  152.   struct lcrecord_header header;
  153.   Lisp_Object name;
  154.   Lisp_Object device;
  155.  
  156.   unsigned short ascent;    /* extracted from `font', or made up */
  157.   unsigned short descent;
  158.   unsigned short width;
  159.   unsigned short height;
  160.   char proportional_p;
  161.  
  162.   /* device-type-specific data */
  163.   void *data;
  164. };
  165.  
  166. #define FONT_INSTANCE_NAME(f) ((f)->name)
  167. #define FONT_INSTANCE_DEVICE(f) ((f)->device)
  168.  
  169. #define FONT_INSTANCE_WIDTH(f) ((f)->width)
  170. #define FONT_INSTANCE_HEIGHT(f) ((f)->height)
  171. #define FONT_INSTANCE_ASCENT(f) ((f)->ascent)
  172. #define FONT_INSTANCE_DESCENT(f) ((f)->descent)
  173.  
  174. #endif /* _XEMACS_OBJECTS_H_ */
  175.